﻿using System;

namespace ForgeCraft
{
    public class CmdSetSpawn : Command
    {
        public override string name { get { return "setspawn"; } }
        public override string shortcut { get { return "ss"; } }
        public override string type { get { return "op"; } }
        public override bool consoleUsable { get { return false; } }
        public override Permission defaultRank { get { return Permission.Guest; } }
        public CmdSetSpawn() { }

        public override void Use(Player p, string message)
        {
            p.currentWorld.spawn = p.pos;
            p.currentWorld.spawn.y += 2;
            p.currentWorld.SaveWorld();
            Server.SendToAll(p.info.group.color + p.name + Color.Sys + " has updated the map's spawn position.");
        }
        public override void Help(Player p)
        {
            p.Message(Color.Aqua + "/setspawn " + Color.Help + "- Sets your current position as the spawn position of the map.");
        }
    }
}